home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
ai
/
prlg195b.lzh
/
SAMPLES.LZH
/
FOR.PRO
< prev
next >
Wrap
Text File
|
1987-05-30
|
256b
|
7 lines
/* This is a test of using a FOR loop in prolog */
for(X, [X, Z]) :- X =< Z.
for(X, [Y, Z]) :- W is Y + 1, W =< Z, for(X, [W, Z]).
?-nl, for(X, [1, 10]), print(X, ' '), X = 10.